package com.tequila.domain.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * Created by fe on 2017/7/1.
 */
public enum ManagerTypeEnum {

    SUPER_ADMIN("superAdmin", "超级管理员"),
    STATION_MASTER("personal", "普通用户"),;

    ManagerTypeEnum(String code, String text) {
        this.code = code;
        this.text = text;
    }

    private String code;
    private String text;

    public String getText() {
        return text;
    }
    public String getCode() {
        return code;
    }

    public static ManagerTypeEnum fromCode(String code) {
        for (ManagerTypeEnum newsTypeEnum : ManagerTypeEnum.values()) {
            if (StringUtils.equals(code, newsTypeEnum.getCode())) {
                return newsTypeEnum;
            }
        }
        return null;
    }
}
